#include "GameNode.h"

GameNode::GameNode()
{
	mTransform = new Transform(this);
}

GameNode::~GameNode()
{
}

void GameNode::addChild(RefPtr<GameNode> pChild)
{
	mChildren.push_back(pChild);
	pChild->mParent = this;
}

//-----------------------------------------------------------

void GameNode::Update()
{
	mTransform->Update();

	std::list<RefPtr<GameNode> >::iterator lIt = mChildren.begin();

	while(lIt != mChildren.end())
	{
		lIt->getRef()->Update();
		lIt++;
	}
}